package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 护理项目Mapper接口
 * @author lsq
 */
@Mapper
public interface NursingProjectMapper {

    Page<NursingProjectVo> selectByPage(String name, Integer status);

    @Select("select count(*) from nursing_project where name = #{name}")
    Integer getNursingProjectByName(String name);

    void add(NursingProject nursingProject);

    NursingProjectVo selectById(Long id);

    void update(NursingProject nursingProject);

    @Update("update nursing_project set status = #{status} where id = #{id}")
    void updateStatus(Long id, Integer status);


    void delete(Long id);

    @Select("select * from nursing_project where id = #{id}")
    NursingProject getById(Long id);

    //查询所有护理项目
    @Select("select * from nursing_project")
    List<NursingProjectVo> getAll();
}